$OpenBSD: patch-libgc_dyn_load_c,v 1.2 2014/12/29 10:49:12 robert Exp $
--- libgc/dyn_load.c.orig	Sun Dec 28 16:23:54 2014
+++ libgc/dyn_load.c	Sun Dec 28 16:24:45 2014
@@ -91,6 +91,13 @@
 #   define ELFSIZE ARCH_ELFSIZE
 #endif
 
+#if defined(OPENBSD)
+# include <sys/param.h>
+# if OpenBSD >= 200519
+#   define HAVE_DL_ITERATE_PHDR
+# endif
+#endif /* OPENBSD */
+
 #if (defined(LINUX) || defined(NACL)) && defined(__ELF__) || defined(SCO_ELF) || \
     (defined(FREEBSD) && defined(__ELF__)) || defined(DGUX) || \
     (defined(OPENBSD) && defined(__ELF__)) || \
@@ -396,7 +403,8 @@ GC_bool GC_register_main_static_data()
 
 # if (defined(LINUX) || defined (__GLIBC__) || defined(NACL)) /* Are others OK here, too? */ \
      && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-         || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) 
+         || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) \
+     || defined(OPENBSD)
 
 /* We have the header files for a glibc that includes dl_iterate_phdr.	*/
 /* It may still not be available in the library on the target system.   */
